package at.ac.univie.zsu.aguataplan.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.NotNull;

/**
 * @author gerry
 * 
 */
@Entity
public class EventAttributeValueRange extends EventAttributeValue {

	@NotNull
	@Column
	private int valueFrom;

	@NotNull
	@Column
	private int valueTo;

	// ----------------------------------------------------
	// CONSTRUCTOR
	// ----------------------------------------------------

	public EventAttributeValueRange() {

	}

	// ----------------------------------------------------
	// COMPARABLE
	// ----------------------------------------------------

	@Override
	public int compareTo(EventAttributeValue o) {
		// TODO: add compareTo statement
		return -1;
	}

	// ----------------------------------------------------
	// METHODS
	// ----------------------------------------------------
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Id: ").append(getId()).append(", ");
		sb.append("RefAttribute: ").append(getRefEventAttribute() == null ? "null" : getRefEventAttribute().size())
				.append(", ");
		sb.append("RefDetectedEvent: ").append(getRefDetectedEvent()).append(", ");
		sb.append("ValueFrom: ").append(getValueFrom()).append(", ");
		sb.append("ValueTo: ").append(getValueTo()).append(", ");
		sb.append("Version: ").append(getVersion());
		return sb.toString();
	}

	// ----------------------------------------------------
	// GETTER & SETTER
	// ----------------------------------------------------

	public int getValueFrom() {
		return valueFrom;
	}

	public void setValueFrom(int valueFrom) {
		this.valueFrom = valueFrom;
	}

	public int getValueTo() {
		return valueTo;
	}

	public void setValueTo(int valueTo) {
		this.valueTo = valueTo;
	}

}
